package api

import (
	"os"
	"syscall"
)

func fileIsExit(path string) bool {
	_, err := os.Stat(path)
	if err == nil {
		return true
	}
	if os.IsNotExist(err) {
		return false
	}
	return false
}

func getApiProc(name string) *syscall.LazyProc {
	return api.NewProc(name)
}

func getCurrentApiDLL() *syscall.LazyDLL {

	apiDLLName := "MyQQApi.dll"

	switch {

	case fileIsExit("bin/MyQQApi.dll"): // 寻找dll文件
		{
			apiDLLName = "MyQQApi.dll"
		}

	case fileIsExit("Bot/WolfApi.dll"):
		{
			apiDLLName = "WolfApi.dll"
		}

	}
	return syscall.NewLazyDLL(apiDLLName)

}

var (
	api = getCurrentApiDLL()

	// 获取dll api
	api_红包_K歌红包           = getApiProc(中文DLL名("Api_红包_K歌红包"))
	mp3ToAmr              = getApiProc("Mp3ToAmr")
	silkToWav             = getApiProc("silkToWav")
	tea加密                 = getApiProc("Api_TeaEncrypt")
	tea解密                 = getApiProc("Api_TeaDecrypt")
	wavToAmr              = getApiProc("Api_WavToAmr")
	取是否在线                 = getApiProc("Api_IsOnline")
	查询红包领取详情              = getApiProc("Api_HB_Detial")
	查询红包领取详情Ex            = getApiProc("Api_HB_DetialEx")
	查询群收钱账单详情             = getApiProc("Api_GetGroupPayDetail")
	api_红包_查询余额           = getApiProc(中文DLL名("Api_红包_查询余额"))
	撤回消息                  = getApiProc("Api_WithdrawMsg")
	创建群聊                  = getApiProc("Api_CreateGroup_A")
	创建群聊_B                = getApiProc("Api_CreateGroup_B")
	创建讨论组                 = getApiProc("Api_CreateDisGroup")
	戳一戳                   = getApiProc("Api_ShakeWindow")
	登录QQ                  = getApiProc("Api_Login")
	api_UpVote            = getApiProc("Api_UpVote")
	api_UpVoteEx          = getApiProc("Api_UpVoteEx")
	发表说说                  = getApiProc("Api_PubSay")
	发表说说_带图               = getApiProc("Api_PubSayAddImg")
	发表说说_带图_多图            = getApiProc("Api_PubSayAddImgBatch")
	发表说说_带图Ex             = getApiProc("Api_PubSayAddImgEx")
	发起群收钱                 = getApiProc("Api_CreateGroupPay")
	发起群投票_单选              = getApiProc("Api_PublishVote_A")
	发起群投票_多选              = getApiProc("Api_PublishVote_B")
	发送封包                  = getApiProc("Api_SendPack")
	发送好友语音                = getApiProc("Api_SendVoice")
	发送群临时会话文件             = getApiProc("Api_UpGroupTempFile")
	发送群收钱账单催收通知           = getApiProc("Api_SendGroupPayMsg")
	api_SendMsgEx         = getApiProc("Api_SendMsgEx")
	api_SendXml           = getApiProc("Api_SendXml")
	api_SendJson          = getApiProc("Api_SendJson")
	api_SendLongMsg       = getApiProc("Api_SendLongMsg")
	发送邮件                  = getApiProc("Api_SendMail")
	关闭群收钱                 = getApiProc("Api_CloseGroupPay")
	api_红包_红包记录           = getApiProc(中文DLL名("Api_红包_红包记录"))
	获取ClientType          = getApiProc("Api_GetClientType")
	获取ClientVer           = getApiProc("Api_GetClientVer")
	获取HttpConn16Key       = getApiProc("Api_GetHttpConn16Key")
	获取HttpConn64Token     = getApiProc("Api_GetHttpConn64Token")
	获取HttpConnip443       = getApiProc("Api_GetHttpConnip443")
	获取HttpConnip80        = getApiProc("Api_GetHttpConnip80")
	获取HttpConnip8080      = getApiProc("Api_GetHttpConnip8080")
	获取ReleaseNo           = getApiProc("Api_GetReleaseNo")
	获取登录二维码               = getApiProc("Api_CreatQrCodeInfo")
	获取二维码登录状态             = getApiProc("Api_GetQrCodeStatus")
	获取二维码图片路径             = getApiProc("Api_GetQrCodePath")
	获取封面图片                = getApiProc("Api_GetCoverPic")
	获取加群链接                = getApiProc("Api_GetGroupUrl")
	获取空间访客                = getApiProc("Api_GetFriendTranslate")
	获取历史群验证消息             = getApiProc("Api_GetGroupHistoryVerifi")
	获取群成员分布               = getApiProc("Api_GetGroupMerDis")
	获取群成员加群时间             = getApiProc("Api_GetGroupMerJoinTime")
	获取群成员头衔               = getApiProc("Api_GetGroupMerRank")
	获取群成员最后发言时间           = getApiProc("Api_GetGroupMerLastTime")
	获取群管理员操作记录            = getApiProc("Api_GetGroupAdminLog")
	api_GetGroupFileList  = getApiProc("Api_GetGroupFileList")
	api_GetGroupFileUrl   = getApiProc("Api_GetGroupFileUrl")
	获取扫码登录QQ号             = getApiProc("Api_GetQrQQNumber")
	获取照片墙                 = getApiProc("Api_GetPhotoWall")
	计算g_tk                = getApiProc("Api_GetG_tk")
	禁用插件自身                = getApiProc("Api_DisabledPlugin")
	api_红包_口令红包           = getApiProc(中文DLL名("Api_红包_口令红包"))
	框架版本                  = getApiProc("Api_GetVer")
	领取红包_初始化              = getApiProc("Api_HB_Init")
	领取红包_群聊红包             = getApiProc("Api_HBRec_Group")
	批量设置个人信息              = getApiProc("Api_SetInfoBatch")
	api_红包_拼手气红包          = getApiProc(中文DLL名("Api_红包_拼手气红包"))
	api_红包_普通红包           = getApiProc(中文DLL名("Api_红包_普通红包"))
	取Bkn                  = getApiProc("Api_GetBkn")
	取Clientkey            = getApiProc("Api_GetClientkey")
	取Cookies              = getApiProc("Api_GetCookies")
	api_GetGroupPsKey     = getApiProc("Api_GetGroupPsKey")
	api_GetZonePsKey      = getApiProc("Api_GetZonePsKey")
	api_GetBlogPsKey      = getApiProc("Api_GetBlogPsKey")
	api_GetClassRoomPsKey = getApiProc("Api_GetClassRoomPsKey")
	api_GetTenPayPsKey    = getApiProc("Api_GetTenPayPsKey")
	api_GetJuBaoPsKey     = getApiProc("Api_GetJuBaoPsKey")
	api_GetQQInfoPsKey    = getApiProc("Api_GetQQInfoPsKey")
	api_GetQQVIPPsKey     = getApiProc("Api_GetQQVIPPsKey")
	取QQ等级                 = getApiProc("Api_GetQQLevel")
	取QQ等级信息               = getApiProc("Api_GetQQLevelInfo")
	取QQ资料                 = getApiProc("Api_GetObjInfo")
	取Q龄                   = getApiProc("Api_GetQQAge")
	取SessionKey           = getApiProc("Api_SessionKey")
	取插件状态                 = getApiProc("Api_IsEnable")
	取达人天数                 = getApiProc("Api_GetExpertDays")
	取短信详情                 = getApiProc("Api_GetJoinGroupMsg")
	取个人说明                 = getApiProc("Api_GetPerExp")
	取个性签名                 = getApiProc("Api_GetSign")
	取公司                   = getApiProc("Api_GetCompany")
	取好友备注                 = getApiProc("Api_GetFriendsRemark")
	取好友列表                 = getApiProc("Api_GetFriendList")
	取好友列表_B               = getApiProc("Api_GetFriendList_B")
	取好友验证方式               = getApiProc("Api_GetQQAddMode")
	取机器人屏蔽状态              = getApiProc("Api_GetShieldedState")
	取机器人状态                = getApiProc("Api_GetStatus")
	api_GetOnlineQQlist   = getApiProc("Api_GetOnlineQQlist")
	api_GetQQList         = getApiProc("Api_GetQQList")
	api_GetOffLineList    = getApiProc("Api_GetOffLineList")
	取框架日志                 = getApiProc("Api_GetLog")
	取名片赞数量                = getApiProc("Api_GetLikeNum")
	取某人是否被禁言              = getApiProc("Api_getOthIsShutup")
	取昵称                   = getApiProc("Api_GetNick")
	取年龄                   = getApiProc("Api_GetAge")
	取群成员列表                = getApiProc("Api_GetGroupMemberList")
	取群成员列表_B              = getApiProc("Api_GetGroupMemberList_B")
	取群成员列表_C              = getApiProc("Api_GetGroupMemberList_C")
	取群成员信息                = getApiProc("Api_GetGroupMemberInfo")
	取群公告                  = getApiProc("Api_GetNotice")
	取群公告已阅读人员             = getApiProc("Api_GetNoticDetail")
	取群管理                  = getApiProc("Api_GetAdminList")
	取群管理Ex                = getApiProc("Api_GetAdminListEx")
	取群介绍                  = getApiProc("Api_GetGroupIntroduce")
	取群聊等级                 = getApiProc("Api_GetGroupChatLv")
	取群列表                  = getApiProc("Api_GetGroupList")
	取群列表_A                = getApiProc("Api_GetGroupList_A")
	取群列表_B                = getApiProc("Api_GetGroupList_B")
	取群名                   = getApiProc("Api_GetGroupName")
	取群名Ex                 = getApiProc("Api_GetGroupNameEx")
	取群名片                  = getApiProc("Api_GetGroupCard")
	取群人数                  = getApiProc("Api_GetGroupMemberNum")
	取群设置信息                = getApiProc("Api_GetGroupSetInfo")
	取群是否全体禁言              = getApiProc("Api_getAllIsShutup")
	取群验证方式                = getApiProc("Api_GetGroupAddMode")
	取群验证方式Ex              = getApiProc("Api_GetGroupAddModeEx")
	取生日                   = getApiProc("Api_GetBirthday")
	取是否允许临时会话             = getApiProc("Api_GetWpa")
	取是否允许群成员发起临时会话        = getApiProc("Api_GetGroupTempSession")
	取是否允许群成员发起临时会话Ex      = getApiProc("Api_GetGroupTempSessionEx")
	取是否允许群成员发起群聊          = getApiProc("Api_GetGroupLaunchNew")
	取是否允许群成员发起群聊Ex        = getApiProc("Api_GetGroupLaunchNewEx")
	取是否支持匿名               = getApiProc("Api_GetAnon")
	取搜索群                  = getApiProc("Api_SearchGroup")
	取讨论组成员列表              = getApiProc("Api_GetDisGroupMemberList")
	取讨论组列表                = getApiProc("Api_GetDisGroupList")
	取图片下载连接               = getApiProc("Api_GetPicLink")
	取消二维码登录               = getApiProc("Api_CloseQrCode")
	取消设置群精华消息             = getApiProc("Api_DelMsgEssence")
	取消特别关心                = getApiProc("Api_DelSpecialCare")
	取性别                   = getApiProc("Api_GetGender")
	取学校                   = getApiProc("Api_GetSchool")
	取邮箱                   = getApiProc("Api_GetEmail")
	取语音下载地址               = getApiProc("Api_GetVoiceLink")
	取在线状态                 = getApiProc("Api_GetOnlineState")
	取长Bkn                 = getApiProc("Api_GetBkn32")
	取长Clientkey           = getApiProc("Api_GetLongClientkey")
	取长Ldw                 = getApiProc("Api_GetLongLdw")
	// 取指令参数
	取自己是否被禁言               = getApiProc("Api_getMeIsShutup")
	群ID转群号                 = getApiProc("Api_GidGetGN")
	群号转群ID                 = getApiProc("Api_GNGetGid")
	群礼物查询                  = getApiProc("Api_CheckGift")
	群礼物抽取                  = getApiProc("Api_TakeGift")
	群礼物赠送                  = getApiProc("Api_GiveGift")
	群聊图片GUI转私聊GUID         = getApiProc("Api_GroupGUIDToFriend")
	群收钱账单是否已支付             = getApiProc("Api_GroupPayIsOk")
	群作业发布                  = getApiProc("Api_PBHomeWork")
	删除QQ                   = getApiProc("Api_DelQQ")
	删除照片墙                  = getApiProc("Api_DelPhotoWall")
	上传好友文件                 = getApiProc("Api_UpFriendFile")
	上传群文件                  = getApiProc("Api_UpGroupFile")
	上传图片                   = getApiProc("Api_UpLoadPic")
	上传图片ExNew              = getApiProc("Api_UpLoadPicExNew")
	上传语音                   = getApiProc("Api_UpLoadVoice")
	上传照片墙                  = getApiProc("Api_UpPhotoWall")
	设置特别关心                 = getApiProc("Api_SetSpecialCare")
	申请加群                   = getApiProc("Api_JoinGroup")
	申请加群Ex                 = getApiProc("Api_JoinGroupEx")
	私聊图片GUI转群聊GUID         = getApiProc("Api_FriendGUIDToGroup")
	提交短信验证                 = getApiProc("Api_CheckJoinGroupMsg")
	添加QQ                   = getApiProc("Api_AddQQ")
	添加好友                   = getApiProc("Api_AddFriend")
	添加好友Ex                 = getApiProc("Api_AddFriendEx")
	添加好友Max                = getApiProc("Api_AddFriendMax")
	添加群机器人                 = getApiProc("Api_AddGroupRobot")
	退出讨论组                  = getApiProc("Api_QuitDisGroup")
	退群                     = getApiProc("Api_QuitGroup")
	下线QQ                   = getApiProc("Api_Logout")
	下线其他设备                 = getApiProc("Api_OfflineOtherDevice")
	修改群验证方式                = getApiProc("Api_SetGroupVerify")
	邀请别人群成员                = getApiProc("Api_InviteGroup_other")
	邀请别人群成员Ex              = getApiProc("Api_InviteGroup_otherEx")
	api_NoAdminInviteGroup = getApiProc("Api_NoAdminInviteGroup")
	api_AdminInviteGroup   = getApiProc("Api_AdminInviteGroup")
	api_红包_一笔画红包           = getApiProc(中文DLL名("Api_红包_一笔画红包"))
	移除群机器人                 = getApiProc("Api_DelGroupRobot")
	api_红包_引力球红包           = getApiProc(中文DLL名("Api_红包_引力球红包"))
	api_红包_语音红包            = getApiProc(中文DLL名("Api_红包_语音红包"))
	置单项好友                  = getApiProc("Api_DelFriend_A")
	置管理员                   = getApiProc("Api_SetAdmin")
	置好友备注                  = getApiProc("Api_SetFriendsRemark")
	置好友验证方式                = getApiProc("Api_SetFriendVerify")
	置好友验证方式Ex              = getApiProc("Api_SetFriendVerifyEx")
	置好友验证事件                = getApiProc("Api_HandleFriendEvent")
	置好友语音上传                = getApiProc("Api_SendVoice")
	置机器人昵称                 = getApiProc("Api_SetNick")
	置机器人签名                 = getApiProc("Api_SetSign")
	置机器人头像                 = getApiProc("Api_UpLoad")
	置机器人性别                 = getApiProc("Api_SetGender")
	置机器人状态                 = getApiProc("Api_SetStatus")
	置拉入黑名单                 = getApiProc("Api_AddBkList")
	置禁言                    = getApiProc("Api_Shutup")
	置禁言Ex                  = getApiProc("Api_ShutupEx")
	置解除黑名单                 = getApiProc("Api_DelBkList")
	置匿名开关                  = getApiProc("Api_SetAnon")
	置屏蔽群消息                 = getApiProc("Api_SetShieldedGroup")
	置全群禁言                  = getApiProc("Api_ShutupGroup")
	置群成员发起临时会话开关           = getApiProc("Api_SetGroupTempSession")
	置群成员发起群聊开关             = getApiProc("Api_SetGroupLaunchNew")
	置群公告                   = getApiProc("Api_PBGroupNotic")
	置群精华消息                 = getApiProc("Api_SetMsgEssence")
	置群名称                   = getApiProc("Api_SetGroupName")
	置群名片                   = getApiProc("Api_SetGroupCard")
	置群头像                   = getApiProc("Api_SetGroupHeadPic")
	置群头像Ex                 = getApiProc("Api_SetGroupHeadPicEx")
	置群验证事件                 = getApiProc("Api_HandleGroupEvent")
	置删除好友                  = getApiProc("Api_DelFriend")
	置输入状态                  = getApiProc("Api_BeInput")
	置讨论组名称                 = getApiProc("Api_SetDisGroupName")
	置踢出群成员                 = getApiProc("Api_KickGroupMBR")
	置邀请讨论组                 = getApiProc("Api_InviteDisGroup")
	置移除讨论组成员               = getApiProc("Api_KickDisGroupMBR")
	重载自身                   = getApiProc("Api_Reload")
	api_红包_专享红包            = getApiProc(中文DLL名("Api_红包_专享红包"))
	转发群文件到好友               = getApiProc("Api_FileGroupToFriend")
	转发群文件到群                = getApiProc("Api_FileGroupToGroup")
	api_红包_转账              = getApiProc(中文DLL名("Api_红包_转账"))
	outPutLog              = getApiProc("Api_OutPut")
)
